<?php

session_start();
if (!isset($_SESSION['user']) || isset($_SESSION['admin'])) {
    header('location:show_mobile.php?mbname=' . $_GET['mbname'] . '&mustlogin=1');
} else {
    $cart = $_SESSION['cart'];
    $id = $_GET['productid'];
    if ($id == 0) {
        unset($_SESSION['cart']);
        header("location:cart.php");
        exit();
    } else {
        unset($_SESSION['cart'][$id]);
    }
    header("location:cart.php");
}
?>